from Daywu.yuekao.Po.Base.Base import Base
from selenium.webdriver.common.by import By
from time import sleep
class Page1(Base):
    # 定位
    # 点击登录
    login_loc=(By.XPATH,'//*[@id="body"]/div[1]/div[2]/div/div[2]/div[1]/div[1]')
    # 账号登录
    zhanghao_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[1]/div/div/div/div[2]/a')
    # 手机号
    phone_loc=(By.XPATH,'//input[@name="userName" and @placeholder="手机号/用户名/邮箱"]')
    # 密码
    pwd_loc=(By.CSS_SELECTOR,'#body > div.quc-panel.quc-wrapper.quc-panel-small.quc-panel-dialog.quc-panel-popup > div.quc-panel-bd > div > div > div > div.quc-login-content > form > div:nth-child(2) > div > div > input[type=password]')
    # 输入
    shuru_loc=(By.CLASS_NAME,'search-ipt')
    # 协议
    xieyi_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[2]/div/div/div/div[2]/form/div[4]/div/label/input')
    # 登录
    l_loc=(By.XPATH,'//*[@id="body"]/div[12]/div[2]/div/div/div/div[2]/form/div[5]/input')
    # 商品
    tu_loc=(By.XPATH,'//*[@id="body"]/div[4]/div[1]/div[2]/div[2]/div/div/div[1]/div[1]/a')
    # 购物车
    cart_loc=(By.XPATH,'//*[@id="body"]/div[4]/div/div[1]/div[2]/div[3]/div/div[2]/div[2]/span/a[1]')

    #
    def login(self):
        self.click(self.login_loc)
    def zhanghao(self):
        self.click(self.zhanghao_loc)
    def phone(self):
        self.send_keys(self.phone_loc,'15614099768')
    def pwd(self):
        self.send_keys(self.pwd_loc, 'hhy041021')
    def xieyi(self):
        self.click(self.xieyi_loc)
    def l(self):
        self.click(self.l_loc)
    def tu(self):
        self.click(self.tu_loc)
    def cart(self):
        self.click(self.cart_loc)

    # def city1(self):





